package com.snap.vseries.bean;

import java.io.Serializable;

import io.protostuff.Tag;

public class ProgramSection implements Serializable, Cloneable {

    /**
     * 秒
     */
    @Tag(1)
    private int duration;
    @Tag(2)
    private float temp;
    /**
     * 表示进行采光操作，false反之
     */
    @Tag(3)
    private boolean lighting;
    /**
     * 从1开始
     */
    @Tag(4)
    private int sectionIndex;
    private transient int cycleCount = 1;
    /**
     * 是否选中
     */
    private transient boolean isChecked;

    public ProgramSection() {
    }

    public ProgramSection(int duration, float temp, int sectionIndex) {
        this.duration = duration;
        this.temp = temp;
        this.sectionIndex = sectionIndex;
    }

    public int getCycleCount() {
        return cycleCount;
    }

    public void setCycleCount(int cycleCount) {
        this.cycleCount = cycleCount;
    }

    public int getSectionIndex() {
        return sectionIndex;
    }

    public void setSectionIndex(int sectionIndex) {
        this.sectionIndex = sectionIndex;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public float getTemp() {
        return temp;
    }

    public void setTemp(float temp) {
        this.temp = temp;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public boolean isLighting() {
        return lighting;
    }

    public void setLighting(boolean lighting) {
        this.lighting = lighting;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ProgramSection info = (ProgramSection) o;

        if (duration != info.duration) {
            return false;
        }
        if (temp != info.temp) {
            return false;
        }
        return lighting == info.lighting;
    }
}
